const obj = {};

Reflect.defineProperty(obj, "name", {
  value: "张三",
  writable: true,
  configurable: true,
  enumerable: false,
});
Reflect.defineProperty(obj, "age", {
  value: 34,
  writable: true,
  configurable: true,
  enumerable: true,
});

console.log(obj); // 无法读取 name 属性
for (let key in obj) {
  console.log(key); // age
}
// console.log(Object.getOwnPropertyDescriptors(obj)); // 获取对象的所有属性描述符
